<% id = document.id %>
<tr id="document_<%= id %>">
  <td>&nbsp;
    <% if current_user and document.depositor != current_user.user_key %>
      <i class="glyphicon glyphicon-share-alt"/>
    <% end %>
  </td>
  <td>
    <div class="media">
      <%= link_to document, class: "media-left" do %>
        <%= render_thumbnail_tag document, { class: "hidden-xs file_listing_thumbnail" }, { suppress_link: true } %>
      <% end %>
      <div class="media-body">
        <h4 class="media-heading">
          <%= link_to document.title_or_label, document, id: "src_copy_link#{id}", class: "#{'document-title' if document.title_or_label == document.label}" %>
          <a href="#" class="small" title="Click for more details"><i id="expand_<%= id %>" class="glyphicon glyphicon-chevron-right"></i></a>
        </h4>
        <%= render_collection_links(document) %>
      </div>
    </div>
  </td>
  <td class="text-center"><%= document.date_uploaded %> </td>
  <td class="text-center">
    <%= render_visibility_link(document) %>
  </td>
  <% if current_user %>
    <td class="text-center">
      <%= render 'show_document_list_menu', document: document %>
    </td>
  <% end %>
</tr>
<tr id="detail_<%= id %>"> <!--  document detail"> -->
  <td colspan="6">
    <dl class="expanded-details row">
      <dt class="col-xs-3 col-lg-2">Creator:</dt>
      <dd class="col-xs-9 col-lg-4"><%= document.creator.to_a.to_sentence %></dd>
      <dt class="col-xs-3 col-lg-2">Depositor:</dt>
      <dd class="col-xs-9 col-lg-4"><%= link_to_profile document.depositor %></dd>
      <dt class="col-xs-3 col-lg-2">Edit Access:</dt>
      <dd class="col-xs-9 col-lg-10">
        <% if document.edit_groups.present? %>
          Groups: <%= document.edit_groups.join(', ') %>
          <br/>
        <% end %>
        Users: <%= document.edit_people.join(', ') %>
      </dd>
    </dl>
  </td>
</tr>
